<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/category_list.php");                     // 当前页面的控制器 ?>



<body>

<!--顶部栏-->
<div id="topbar"> <?php include $_SERVER['DOCUMENT_ROOT'] . '/controller/common/module/topbar.php'; ?></div>

<!--容器-->
<div id="container" class="<?php echo $now_extender ?>">

    <!--侧边栏-->
    <div id="sidebar"><?php include $_SERVER['DOCUMENT_ROOT'] . '/controller/common/module/sidebar.php'; ?></div>





    <?php
    //==============================================================================
    //这里开始才是平常开发需要注重的部分，其余的基本不用理会
    //==============================================================================
    ?>


    <div id="content" class="layui-form">

        <!--标题设定-->
        <?php $page_title=$this_plate['name'].'分类列表';?>
        <?php include $_SERVER['DOCUMENT_ROOT']. '/controller/common/module/mod-page-title.php'; ?>

        <!--搜索框-->
        <?php include 'module/mod-category-search.php'; ?>


        <!--功能按钮：新增，统计，全选，排序，导出之类的-->
        <?php include 'module/mod-category-function.php'; ?>



        <!-- 用$now_extender .list_boxe来控制来到确认板块信息显示-->
        <div class="list-box">
            <!--分类列表表格-->
            <?php include 'module/mod-category-list.php'; ?>
        </div>
        <!--list-box end-->


    </div>
    <!--content端點02-->
    <?
    //==============================================================================
    //这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
    //==============================================================================
    ?>





<br class="clearfloat"/>
</div>
<!--container-->


<!--底部栏-->
<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>




<!--载入删除功能-->
<script type="text/javascript" src="/controller/common/asset/js/deleter.js"></script>

<!--载入弹出窗口功能-->
<script type="text/javascript" src="/controller/common/asset/js/window_eject.js"></script>

<!--载入layer弹出元素功能-->
<script type="text/javascript" src="/controller/common/asset/js/layer_show_by_id.js"></script>

<!--载入弹checkbox全选功能；在layui内部实现-->
<script type="text/javascript" src="/controller/common/asset/js/check_all_checkbox.js"></script>

<!--载入弹checkbox全选功能；在layui内部实现-->
<script type="text/javascript" src="/controller/common/asset/js/update_category_publish_status.js"></script>

<!--批量删除按钮的检测-->
<script type="text/javascript" src="/controller/common/asset/js/mulity_delete_button.js"></script>
<!--批量删除功能-->
<script type="text/javascript" src="/controller/common/asset/js/mulity_delete.js"></script>


<script>
    //layui渲染过的元素，需要在这里写函数

    layui.use('form', function(){
        var form = layui.form;

        //layui中，处理checkbox
        check_all_checkbox(form)

        //监控复选框，选择一个就触发删除按钮
        mulity_delete_button(form)

        //监控switch按钮
        form.on('switch(publish_status)', function(data)
        {
            //console.log(data.elem); //得到checkbox原始DOM对象
            //console.log(data.elem.id); //开关是否开启，true或者false
            //console.log(data.elem.checked); //开关是否开启，true或者false
            //console.log(data.value); //开关value值，也可以通过data.elem.value得到
            update_category_publish_status(data.value,data.elem.checked)
        });


    });
</script>




</body>
</html>
